import React, { Component, Fragment} from 'react';
// 引入全局样式
import {
  GlobalStyle
} from './style'
import Header from './common/Header';
import Login from './pages/Login';
import Home from './pages/Home';
import Reg from './pages/Reg';
import Detail from './pages/Detail';
import Looking from './pages/Looking';
import Loving from './pages/Loving';
import Hollow from './pages/Hollow';
import Carpooling from './pages/Carpooling';
import Dynamic from './pages/Dynamic';
import Writing from './pages/Writting';
import {
  BrowserRouter as Router,
  Route
} from 'react-router-dom';
// 引入react-redux模块,给react提供一个组件，从外部封装整个应用，并向connect模块传递state
import { Provider } from 'react-redux';
import store from "./store";


class App extends Component {
  render() {
    return (
      <Fragment>
        <GlobalStyle />
        <Provider store={ store }>
          <div className="App">
            <Router>
              <Fragment>
                <Header />
                <Route path='/' component={ Home } exact />
                <Route path='/login' component={ Login } exact />
                <Route path='/Reg' component={ Reg } exact />
                <Route path='/detail/:id' component={ Detail } exact />
                <Route path='/looking' component={ Looking } exact />
                <Route path='/loving' component={ Loving } exact />
                <Route path='/hollow' component={ Hollow } exact />
                <Route path='/carPooling' component={ Carpooling } exact />
                <Route path='/dynamic' component={ Dynamic } exact />
                <Route path='/writting' component={ Writing } exact />
              </Fragment>
            </Router>
          </div>
        </Provider>
      </Fragment>

    );
  }
}

export default App;
